package com.ruoyi.project.system.device.controller;

public class GassesConsistencyChecker implements Runnable {
    private final double gas1Value;
    private final double gas2Value;
    private final double tolerance;
 
    public GassesConsistencyChecker(double gas1Value, double gas2Value, double tolerance) {
        this.gas1Value = gas1Value;
        this.gas2Value = gas2Value;
        this.tolerance = tolerance;
    }
 
    @Override
    public void run() {
        if (Math.abs(gas1Value - gas2Value) < tolerance) {
            System.out.println("两个真空度一致，可以进行下一步操作。");
            // 在这里执行下一步操作
        } else {
            System.out.println("两个真空度不一致。");
        }
    }
 
    public static void main(String[] args) {
        double gas1Value = 1;
        double gas2Value = 10.6;
        double tolerance = 0.5;
 
        Thread thread = new Thread(new GassesConsistencyChecker(gas1Value, gas2Value, tolerance));
        thread.start();
    }
}